<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改次卡服务')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-userCardTime-edit" th:object="${webUserCardTime}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户昵称：</label>
                <div class="col-sm-8 form-control-static" th:text="*{nickname}">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text" required autocomplete="off">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">用户姓名：</label>
                <div class="col-sm-8 form-control-static" th:text="*{realname}">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">绑定的门店：</label>
                <div class="col-sm-8 form-control-static" th:text="*{deptName}">
                    <input name="deptId" th:field="*{deptId}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">服务项目：</label>
                <div class="col-sm-8 form-control-static" th:text="*{recycleType}">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">卡名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">剩余次数：</label>
                <div class="col-sm-8" th:text="*{times}">
                    <input name="times" th:field="*{times}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">总次数：</label>
                <div class="col-sm-8 form-control-static" th:text="*{countTimes}">
                    <input name="countTimes" th:field="*{countTimes}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">总金额：</label>
                <div class="col-sm-8">
                    <input name="money" th:field="*{money}"  class="form-control number" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">启用状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}" required>
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="row">
        <div class="col-sm-offset-5 col-sm-10">
            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/userCardTime";
        $("#form-userCardTime-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-userCardTime-edit').serialize());
            }
        }
    </script>
</body>
</html>